﻿using System;
using System.Collections.Generic;
using Blader.UI;

namespace Blader.ActionHandler
{
    public class ActionHandlerFactory
    {
        private static Dictionary<string, Type> handler = new Dictionary<string, Type>();

        public static IActionHandler GetHandler(HandlerContext context)
        {
            MenuItem menuItem = MenuItemCollection.FindByName(context.CommandName);
            if (menuItem != null)
            {
                return (IActionHandler)Activator.CreateInstance(menuItem.Handler, null);
            }
            return null;
        }
    }
}
